// 管理员用户接口（axios 版），使用 http 封装与全局返回类型 ApiResponse<T>
import http from './http'
import type { RegisterAdminUserDto, LoginAdminUserDto, AdminUserSummary, LoginUserSummary } from '@/types/user.api'

/** 管理员注册 */
export async function registerAdminUser(
  dto: RegisterAdminUserDto,
): Promise<ApiResponse<AdminUserSummary>> {
  return http.post<RegisterAdminUserDto, AdminUserSummary>('/admin/user/register', dto)
}

/** 管理员登录 */
export async function loginAdminUser(
  dto: LoginAdminUserDto,
): Promise<ApiResponse<LoginUserSummary>> {
  return http.post<LoginAdminUserDto, LoginUserSummary>('/admin/user/login', dto)
}
